package com.qf.day08;

import java.util.Random;

public class Weapon {
    private String name;
    private int weight;
    private String type;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getWeight() {
        return weight;
    }

    public void setWeight(int weight) {
        this.weight = weight;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public Weapon() {
    }

    public Weapon(String name, int weight, String type) {
        this.name = name;
        this.weight = weight;
        this.type = type;
    }

    @Override
    public String toString() {
        return "Weapon{" +
                "name='" + name + '\'' +
                ", weight=" + weight +
                ", type='" + type + '\'' +
                '}';
    }

    public void getWeapons(Weapon[] weapons){
        Weapon weapon1 = new Sword("长剑",10,"铁","银色");
        Weapon weapon2 = new Dagger("短匕",5,"钢",10);


        for (int i = 0; i < weapons.length; i++) {
            weapons[i] = new Weapon();
        }
    }
}
